package com.example.list

import com.chad.library.adapter.base.entity.MultiItemEntity

/**
 * @Author : mjc
 * time    : 2021-05-13
 * desc    : 商品数据
 */
data class ShopModel(
    var code: String? = null,
    var data: ArrayList<Data>? = null,
    var msg: String? = null,
    var success: Boolean? = null
) {
    data class Data(
        var children: ArrayList<Children>? = null,
        var id: String? = null,
        var image: String? = null,
        var label: String? = null,
        var sort: String? = null,
        var superiorId: String? = null,
    ) {
        data class Children(
            var children: ArrayList<Children>? = null,
            var id: String? = null,
            var image: String? = null,
            var label: String? = null,
            var sort: String? = null,
            var superiorId: String? = null,
            var isHead: Boolean? = null    //自定义字段，用于判断是否头部布局
        ) : MultiItemEntity {
            data class Children(
                var children: Any? = null,
                var id: String? = null,
                var image: String? = null,
                var label: String? = null,
                var sort: String? = null,
                var superiorId: String? = null
            )

            override val itemType: Int
                get() = if (isHead == true) 0 else 1
        }
    }


}